! compile with, e.g. gfortran tlapackdet.f90 lapackfundet.f90 -llapack
program tlapackdet

  implicit none
!  integer(kind=8) :: N
  integer :: N
  real(kind=8), allocatable, dimension(:,:) :: mat
!  complex(kind=8), allocatable, dimension(:,:) :: mat
  real(kind=8) ::  finddet, detans
!   complex(kind=8) :: det, detans

  N=2

  allocate(mat(N,N))

  mat(1,1)=5
  mat(1,2)=1
  mat(2,1)=1
  mat(2,2)=1

  write(*,*)' initial mat:'
  write(*,*) mat


  detans= finddet(N, mat)

  write(*,*)' det=', detans

end program tlapackdet
